/*
 * Project Name: jmax
 * File Name: CmdManager.java
 * Copyright: Copyright(C) 1985-2015 ZKTeco Inc. All rights reserved.
 */
package com.xdtech.hotel.protocol.cmd;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * @author max.zheng
 * @since 2015-4-3 上午11:18:00
 */
public class CmdManager extends CmdCache
{
	private static Log log = LogFactory.getLog(CmdManager.class);
	/**
	 * 添加命令
	 * 
	 * @author max.zheng
	 * @since 2015-4-7 上午11:34:34
	 * @param cmd
	 */
	public static void addCmd(String cmd) {
		cmdQueues.add(cmd);
	}
	
	/**
	 * 弹出队列第一条命令
	 * 
	 * @author <a href="max.zheng@zkteco.com">郑志雄</>
	 * @since 2015-4-7 上午11:36:16
	 * @return
	 */
	public static String pollCmd() {
		return cmdQueues.poll();
	}
	/**
	 * 获取命令数
	 * 
	 * @author max.zheng
	 * @since 2015-4-7 上午11:34:51
	 * @return
	 */
	public static int getCmdCount() {
		return cmdQueues.size();
	}
	
	
}
